import request from "@/utils/request";

//獲取商品搜索列表的數據
export const getSearchData = (obj) => {
  const { sortType, categoryId, goodsName, page } = obj;
  return request.get("/goods/list", {
    params: {
      sortType,
      categoryId,
      goodsName,
      page,
    },
  });
};

export const getDetailData = (goodsId) => {
  return request.get("/goods/detail", {
    params: {
      goodsId,
    },
  });
};
//獲取評論
export const getCommentData = (goodsId, limit) => {
  return request.get("/comment/listRows", {
    params: {
      goodsId,
      limit,
    },
  });
};
